package main.app
{
	
	import feathers.controls.ScreenNavigator;
	import feathers.controls.ScreenNavigatorItem;
	import feathers.events.FeathersEventType;
	import feathers.motion.transitions.ScreenFadeTransitionManager;
	import feathers.themes.MetalWorksMobileTheme;
	
	import main.app.view.screens.LoginMenu;
	import main.app.view.screens.MainMenu;
	import main.app.view.screens.RegisterMenu;
	import main.app.view.screens.ScreenConstants;
	
	import starling.display.Sprite;
	
	public class GameApp extends Sprite
	{
		//服务端的http地址字符串
		private var urlStr:String = "http://192.168.0.44/SpringMvc/hello.do";
		
		//****
		//由此正式进入游戏程式
		//*****
		
		private var _theme:MetalWorksMobileTheme;
		private var _navigator:ScreenNavigator;
		private var _transitionManager:ScreenFadeTransitionManager;
		
		
		public function GameApp()
		{
			trace("已进入游戏主体");
			initUISystem();
		}
		
		private function initUISystem():void
		{
			_theme = new MetalWorksMobileTheme(this,true);
			this._navigator = new ScreenNavigator();
			this.addChild(this._navigator);
			
			_navigator.addScreen( ScreenConstants.LOGIN_MENU,new ScreenNavigatorItem(LoginMenu,
				{
					showMainMenu:ScreenConstants.MAIN_MENU,
					showRegisterMenu:ScreenConstants.REGISTER_MENU
				}));
			
			_navigator.addScreen( ScreenConstants.MAIN_MENU,new ScreenNavigatorItem(MainMenu));
			
			_navigator.addScreen( ScreenConstants.REGISTER_MENU,new ScreenNavigatorItem(RegisterMenu,
				{
					showLoginMenu:ScreenConstants.LOGIN_MENU
				}));
			
			this._navigator.showScreen(ScreenConstants.LOGIN_MENU);
			this._transitionManager = new ScreenFadeTransitionManager(this._navigator);
			this._transitionManager.duration = 0.4
			
		}
		
		
		
	}
}